package ACM;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * @author way
 * @create 2025-03-29 10:27
 */
public class MeiTuan_1 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<String> tokens = new ArrayList<>();
        String line;

        // 读取所有输入并分割成tokens
        while ((line = br.readLine()) != null) {
            String[] parts = line.trim().split("\\s+");
            for (String s : parts) {
                if (!s.isEmpty()) {
                    tokens.add(s);
                }
            }
        }

        int ptr = 0;
        int T = Integer.parseInt(tokens.get(ptr++));
        for (int t = 0; t < T; t++) {
            int n = Integer.parseInt(tokens.get(ptr++));
            int k = Integer.parseInt(tokens.get(ptr++));
            long sum = 0;

            // 读取n个工作时间
            for (int i = 0; i < n; i++) {
                sum += Integer.parseInt(tokens.get(ptr++));
            }

            // 判断总时长是否合法
            System.out.println(sum <= (long)n * k ? "YES" : "NO");
        }
    }
}
